<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  <div class="main">
 		<div style="height: 34px;">
			巡视时间：<input type="text" name="sdate" id="sdate" class="Wdate" onClick="WdatePicker({ dateFmt: 'yyyy-MM-dd'})"/> 
			关键字：<input type="text" name="roomNumber" id="roomNumber"  placeholder="巡视人员">
			&nbsp; <a class='btn btn-success radius'  onClick=doSearch()  >查 询</a>
			&nbsp; <a id="room_btn_add"  class='btn btn-primary radius' onClick='openAddMan()' >新 增</a> 
		</div>
		<div class="mt-20" style="margin-top:10px;">
			<table id="searchTable_1" width="100%">
				<tr>
					<th w_index="no" width="5%;" w_align="center">序号</th>
					<th w_index="roomNum" width="5%;" w_align="center">房号</th>
					<th w_index="examineDate" width="10%;" w_align="center">巡视时间</th>
					<th w_index="examinePerson" width="5%" w_align="center">巡视人员</th>
					<th w_index="datails" width="10%;" w_render="Data_1">操作</th>
					<th w_hidden="true" w_index="id" >id</th>
				</tr>
			</table>
			<script type="text/javascript">
				var gridObj_1;
				$(function () {
					gridObj_1 = $.fn.bsgrid.init('searchTable_1', {
						url: "project/decorateManager/getJsonData",
						autoLoad: true,
						pageSizeSelect: true, 
						multiSort: true ,
						displayBlankRows: false ,
						pagingLittleToolbar: true,
						stripeRows: true,
						rowHoverColor: true,
						pageSize: 15,
						curPage:1
					});
				});

				function Data_1(record, rowIndex, colIndex, options) {
					var html="";
					var id = gridObj_1.getRecordIndexValue(record, 'id');
					var elementids2 = $("#sys_permissionids").val();
					
					var sys_user_id=$("#sys_user_id").val();
					var addUserid = gridObj.getRecordIndexValue(record, 'addUserid');
					var sys_userid = $("#sys_userid").val();
					html = " &nbsp; &nbsp; <a  href=javascript:look_1('"+id+"'); >查看</a>";
					if(elementids2.indexOf("table_with_a_record-data-edit")!=-1 ||addUserid.indexOf(sys_userid)!=-1 ||addUserid.indexOf(sys_user_id)!=-1){
					html+= " &nbsp; &nbsp; <a href=javascript:edit_1('"+id+"'); >编辑</a>";
					}else{
						html += "&nbsp; &nbsp; <a style='cursor:text'>--</a>";
					}	
					if(elementids2.indexOf("table_with_a_record-data-del")!=-1 ||addUserid.indexOf(sys_userid)!=-1 ||addUserid.indexOf(sys_user_id)!=-1){
					html+=" &nbsp; &nbsp; <a   href=javascript:doDel_1('"+id+"'); >删除</a>";
					}else{
						html += "&nbsp; &nbsp; <a style='cursor:text'>--</a>";
					}
					return html;
				}
				
				function openAddMan() {
					var roomInfoId =　"${roomInfo.id}";
					var url="project/decorateManager/toAddMan/"+roomInfoId;
					openTitleLayer("新增装修",url,900,600);
				}
				
				function edit_1(id) {
					var url="project/decorateManager/toEditMan/"+id;
					openTitleLayer("修改装修",url,900,600);
				}
				
				function doDel_1(id) {
					var url="project/decorateManager/toDelMan";
					layer.confirm("确定删除吗？",{icon:3},function(i){
						jQuery.ajax({
						    type:"post",
							async:false,
							url:url,
							data:{id:id},
							success:function(data){
								if(data.success){
									gridObj_1.refreshPage(); 
								    layer.msg('删除成功！');
								 }else{
								    layer.alert(data.msg,{icon:7});
								 }
							}
						})
					})
				}

			</script>

	
		</div>
 </div>
	
	

